#include "StateConnection.h"
#include "scImpl.h"

#define FCT "StateConnection::StateConnection"
StateConnection::StateConnection() :
	stSetup(-1), stTest(-1), stIdle(-1), stActive(-1), stFailed(-1)
{
	stSetup	=addState("SETUP");
	stTest	=addState("TEST");
	stIdle	=addState("IDLE");
	stActive=addState("ACTIVE");
	stFailed=addState("FAILED");
	// SETUP out
	// no self-transition!
	addTransition(stSetup, stTest);
	// TEST out
	// no self-transition!
	addTransition(stTest, stIdle);
	addTransition(stTest, stFailed);
	// IDLE out
	addTransition(stIdle, stIdle); // not sure if we need this one...
	addTransition(stIdle, stTest);
	addTransition(stIdle, stActive);
	addTransition(stIdle, stFailed);
	// ACTIVE out
	addTransition(stActive, stActive); // important: we queue requests
	addTransition(stActive, stIdle);
	addTransition(stActive, stFailed);
	// FAILED out
	addTransition(stFailed, stFailed); // can't get worse
	addTransition(stFailed, stTest);
}

#undef FCT
#define FCT "StateConnection::~StateConnection"
StateConnection::~StateConnection()
{
}
